<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo1</title>
    <script>
        function closePage(){
            window.close();
        }
    </script>
</head>
<body>
    <h1>我是demo1页面</h1>
    <button onclick="closePage()">关闭</button>
</body>
</html>
<script>
    setTimeout(function (){
        window.close();
    },5000)
</script>